package com.liuzhengting.security.rest;

import com.liuzhengting.common.model.GeneralResult;
import com.liuzhengting.security.service.SysUserService;
import com.liuzhengting.template.service.RoundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sys/user")
public class SysUserRest {
	
	@Autowired
	private SysUserService sysUserService;
	
	/**
	 * 首页
	 * @return
	 */
	@GetMapping("/list")
	public GeneralResult sysUserList(){
		return sysUserService.findSysUserList();
	}
	
	/**
	 * 新建用户
	 * @return
	 */
	@PostMapping("/create")
	public GeneralResult sysUserCreate(@RequestParam String username, @RequestParam String password){
		System.out.println(username);
		System.out.println(password);
		return sysUserService.findSysUserCreate(username, password);
	}
	
	/**
	 * 修改用户
	 * @return
	 */
	@GetMapping("/revamp")
	public GeneralResult sysUserRevamp(){
		return sysUserService.findSysUserRevamp();
	}
	
	/**
	 * 删除用户
	 * @return
	 */
	@GetMapping("/remove")
	public GeneralResult sysUserRemove(){
		return sysUserService.findSysUserRemove();
	}

}
